package com.hopu.dy.controller;

import com.hopu.dy.pojo.CollectNotice;
import com.hopu.dy.service.ICollectNoticeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/collectnotices")
public class CollectNoticeController {

    @Resource
    private ICollectNoticeService collectNoticeService;

    @PostMapping
    public void createCollectNotice(@RequestBody CollectNotice notice) {
        collectNoticeService.createCollectNotice(notice);
    }

    @GetMapping
    public List<CollectNotice> getCollectNotices(@RequestParam Long collectedUserId) {
        return collectNoticeService.getCollectNotices(collectedUserId);
    }
}
